function [PQ] = SS_UpdateTaskPriorities(PQ, servicedTasks, scans)
%SS_AddEqualTasks works out which targets are seen by both sensors.
% Clean up the work list
for t = 1:PQ_Size(PQ)
  Task = PQ_Fetch_Task(PQ, t, 0);
  found = 0;
  for s = 1:size(servicedTasks, 2)
    if Task.id == servicedTasks(s)
      found = 1;
      break;
    end
  end
  if found
    % remove from this priority bin and move to lower
    % as long as this is not the lowest bin already.
    PQ = PQ_Lower_Task_Priority(PQ, t);
  elseif (rand() < (2/scans))
    % Move unscheduled tasks up in priority randomly.
    PQ = PQ_Raise_Task_Priority(PQ, t);
  end
end
end